package com.cx.controller;

import com.cx.pojo.Order;
import com.cx.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class OrderController {
    @Autowired
    OrderService orderService;
    @RequestMapping("insertOrder")
    @ResponseBody
    public int insertOrder(){
        Order order = new Order();
        order.setOther1("111");
        order.setHotelName("上海证大");
        order.setRoomType("超级豪华型");
        order.setOrderStatus((byte) 1);
        return orderService.insert(order);
    }
    @RequestMapping("getOrderInfoByUserName")
    @ResponseBody
    public List<Order> getOrderInfoByUserNameZCJ(){
        System.out.println("男女男");
        return orderService.getOrderInfoByUserName("zcj");
    }
}
